package com.goods.controller.busniess;

import com.goods.business.service.HealthService;
import com.goods.common.response.ResponseBean;
import com.goods.common.vo.business.HealthVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @description：
 * @version:
 * @author：ruixinag
 * @create：Created in 2021/11/10 15:27
 */
@Api(tags = "业务模块-健康报备")
@RestController
@RequestMapping("/business/health")
public class HealthController {
    @Autowired
    private HealthService healthService;

    //是否打卡
    @ApiOperation("是否打卡")
    @GetMapping("/isReport")
    public ResponseBean isReport() {

        HealthVO healthVO = healthService.isReport();
        return ResponseBean.success(healthVO);
    }

    //打卡 report
    @ApiOperation("打卡")
    @PostMapping("/report")
    public ResponseBean report(@RequestBody HealthVO healthVo) {

        healthService.report(healthVo);
        return ResponseBean.success();
    }

    //签到记录 history?pageSize=4&pageNum=1
    @ApiOperation("签到记录")
    @GetMapping("/history")
    public ResponseBean history(@RequestParam Map paramMap) {

        Map map = healthService.history(paramMap);
        return ResponseBean.success(map);
    }


}
